package univer.oko.database.rmi;

import univer.oko.Bank;
import univer.oko.Message;
import univer.oko.olap.OlapCubeInfo;
import univer.oko.olap.report.ReportData;
import univer.oko.order.DedactOrderProject;
import univer.oko.payment.Payment;
import univer.oko.payment.monthly.PaymentMonthlyList;
import univer.oko.query.QueryResult;
import univer.oko.query.baseObjects.DBObject;
import univer.oko.query.baseObjects.DBObjectType;
import univer.oko.search.searchParamsMaps.ISearchParamsMap;
import univer.oko.searchOld.StudentSearchCriteria;
import univer.oko.student.Student;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Vector;


public interface RMI extends Remote {
    public Message saveStudent(Student st) throws RemoteException;

    public Message saveStudentNot(Student st) throws RemoteException;

    public Student getStudent(int id) throws RemoteException;

    public boolean deleteStudent(Student st) throws RemoteException;

    public Message updateStudent(Student st) throws RemoteException;

    public Message restoreStudent(int oldId, Student st) throws RemoteException;

    public boolean cancelDeductStudent(int id) throws RemoteException;

    public Vector searchStudents(String str) throws RemoteException;

    public Vector searchStudents(StudentSearchCriteria criteria) throws RemoteException;

    public Vector searchStudentsReport(Vector options, Vector sources) throws RemoteException;

    public Vector searchPaymentsReport(Vector options, Vector sources) throws RemoteException;

    public ArrayList<Student> searchEntrants(ISearchParamsMap map) throws RemoteException, SQLException;

    public ArrayList<Student> searchStudents(ISearchParamsMap map) throws RemoteException, SQLException;

    /**
     * Searches students those have sum of payments not equal to total sum
     */
    public ArrayList<Student> searchStudentsWithTotalProblems(ISearchParamsMap str) throws RemoteException;

    public Integer getStudentIDByName(String name) throws RemoteException;

    public String getStudentName(int id) throws RemoteException;

    public int addSpeciality(String name, String direction) throws RemoteException;

    public Vector getSpecialities() throws RemoteException;

    public Vector getSpecialities(String direction) throws RemoteException;

    public int deleteSpeciality(String str) throws RemoteException;

    public Integer getSpecialityID(String str) throws RemoteException;

    public String getSpecialityName(int id) throws RemoteException;
    
    


    public int addDirection(String name, String faculty) throws RemoteException;
    
    public Vector getDirections() throws RemoteException;
    
    public Vector getDirections(String faculty) throws RemoteException;

    public Integer getDirectionID(String str) throws RemoteException;

    public String getDirectionName(int id) throws RemoteException;

    public int deleteDirection(String str) throws RemoteException;
    
    
    

    public Vector getDedactOrderNumbers() throws RemoteException;

    public int addFaculty(String str) throws RemoteException;

    public Vector getFaculties() throws RemoteException;

    public int deleteFaculty(String str) throws RemoteException;

    public Integer getFacultyID(String str) throws RemoteException;

    public String getFacultyName(int id) throws RemoteException;

    public String getFacultyNameBySpeciality(String str) throws RemoteException;

    public String getFacultyNameByDirection(String str) throws RemoteException;

    public String getFacultyNameByFinUnit(String str) throws RemoteException;

    public int addFinUnit(String item, String faculty) throws RemoteException;

    public Vector getFinUnits() throws RemoteException;

    public Vector getFinUnits(String str) throws RemoteException;

    public int deleteFinUnit(String str) throws RemoteException;

    public Integer getFinUnitID(String str) throws RemoteException;

    public String getFinUnitName(int id) throws RemoteException;

    public int addEducationForm(String str) throws RemoteException;

    public Vector getEducationForms() throws RemoteException;

    public int deleteEducationForm(String str) throws RemoteException;

    public Integer getEducationFormID(String str) throws RemoteException;

    public String getEducationFormName(int id) throws RemoteException;

    public int addEducationLevel(String str, Vector v) throws RemoteException;

    public Vector getEducationLevels() throws RemoteException;

    public Vector getEducationLevels(String str) throws RemoteException;

    public int deleteEducationLevel(String str) throws RemoteException;

    public Integer getEducationLevelID(String str) throws RemoteException;

    public String getEducationLevelName(int id) throws RemoteException;

    public int addEducationProgram(String str, Vector v) throws RemoteException;

    public Vector getEducationPrograms() throws RemoteException;

    public Vector getEducationPrograms(String str) throws RemoteException;

    public int deleteEducationProgram(String str) throws RemoteException;

    public Integer getEducationProgramID(String str) throws RemoteException;

    public String getEducationProgramName(int id) throws RemoteException;

    public Integer getLtoPID(String level, String program) throws RemoteException;

    public int addBank(Bank bank) throws RemoteException;

    public Vector getBanks() throws RemoteException;

    public int deleteBank(String str) throws RemoteException;

    public Integer getBankID(String str) throws RemoteException;

    public String getBankName(int id) throws RemoteException;

    public Bank getBank(String str) throws RemoteException;

    public int addCountry(String str) throws RemoteException;

    public Vector getCountries() throws RemoteException;

    public int deleteCountry(String str) throws RemoteException;

    public Integer getCountryID(String str) throws RemoteException;

    public String getCountryName(int id) throws RemoteException;

    public int addRegion(String str) throws RemoteException;

    public Vector getRegions() throws RemoteException;

    public Vector getRegions(String str) throws RemoteException;

    public int deleteRegion(String str) throws RemoteException;

    public Integer getRegionID(String str) throws RemoteException;

    public String getRegionName(int id) throws RemoteException;

    public int addCity(String str) throws RemoteException;

    public Vector getCities() throws RemoteException;

    public int deleteCity(String str) throws RemoteException;

    public Integer getCityID(String str) throws RemoteException;

    public String getCityName(int id) throws RemoteException;

    public String getCityNameByArrivalLine(String arrline) throws RemoteException;

    public int addArrivalLine(String line, String city) throws RemoteException;

    public Vector getArrivalLines() throws RemoteException;

    public int deleteArrivalLine(String str) throws RemoteException;

    public Integer getArrivalLineID(String str) throws RemoteException;

    public String getArrivalLineName(int id) throws RemoteException;

    public Vector getAllPaymentTypes() throws RemoteException;

    public Vector getPaymentTypes() throws RemoteException;

    public Integer getPaymentTypeID(String str) throws RemoteException;

    public String getPaymentTypeName(int id) throws RemoteException;

    public String getPaymentTypeNameByReason(String reasonName) throws RemoteException;

    public String getPaymentTypeNameByReason(int idReason) throws RemoteException;

    public int addPaymentForm(String str) throws RemoteException;

    public Vector getPaymentForms() throws RemoteException;

    public int deletePaymentForm(String str) throws RemoteException;

    public String getUsualPaymentForm(int idStudent) throws RemoteException;

    public Integer getPaymentFormID(String str) throws RemoteException;

    public String getPaymentFormName(int id) throws RemoteException;

    public int addReason(String str) throws RemoteException;

    public Vector getReasons() throws RemoteException;

    public ArrayList<String> getReasonNames(String paymentTypeName) throws RemoteException;

    public int deleteReason(String str) throws RemoteException;

    public Vector getReasonsAll() throws RemoteException;

    public Integer getReasonID(String str) throws RemoteException;

    public String getReasonName(int id) throws RemoteException;

    public int addLanguage(String str) throws RemoteException;

    public Vector getLanguages() throws RemoteException;

    public int deleteLanguage(String str) throws RemoteException;

    public Integer getLanguageID(String str) throws RemoteException;

    public String getLanguageName(int id) throws RemoteException;

    public Vector getContractTypes() throws RemoteException;

    public Integer getContractTypeID(String str) throws RemoteException;

    public String getContractTypeName(int id) throws RemoteException;

//    public int moveUpPrepare() throws RemoteException;

    public Message moveUpStudentsOrder(ArrayList<Student> v) throws RemoteException;

//    public int addOrderProject(String str, Vector v) throws RemoteException;

    public Message addDeductOrderProject(DedactOrderProject proj, ArrayList<Student> v) throws RemoteException;

    public Message registerOrderProject(String order, Date date, ArrayList<Student> students) throws RemoteException;
//    public Vector getOrderProjects() throws RemoteException;

    public Vector getOrders() throws RemoteException;

    public Integer getOrderProjectID(Student st) throws RemoteException;

    public String getOrderProjectNumber(int id) throws RemoteException;

    public int saveDedactOrderProject(int id, String param) throws RemoteException;
    // public int saveDedactOrderProject(int id, int idOrder) throws RemoteException;
    
    public Integer getDedactOrderProjectID(Student st) throws RemoteException;

    public DedactOrderProject getDedactOrderOfStudent(Student student) throws RemoteException;

    public String getDedactOrderNumber(int id) throws RemoteException;

    public Message registerPayment(Payment p, Student st) throws RemoteException;

    public Message registerPayment(Student st, String year, double sum, double sum_USD) throws RemoteException;

    public Message updatePayment(Payment p) throws RemoteException;

    public void recountTotals(int id, Date date) throws RemoteException;

    public Payment getPayment(int id) throws RemoteException;

    public boolean deleteStudentPayment(int id) throws RemoteException;

    public boolean deleteNotStudentPayment(int id) throws RemoteException;

    public boolean deletePaymentWithoutRecountTotals(int id) throws RemoteException;


    public Vector searchPayments(Vector options, Vector sources) throws RemoteException;

    public Vector searchPayments(String str) throws RemoteException;

    public ArrayList<Payment> searchPayments(ISearchParamsMap map) throws RemoteException;

    public Vector searchPaymentsNotStudent(String str) throws RemoteException;

    public double countUpArrearsPrepays(int id) throws RemoteException;

    public double countUpArrearsPrepaysBefore(int id) throws RemoteException;

    public double countArrearsPrepaysBasic(int id) throws RemoteException;

    public Vector getPayments(int id) throws RemoteException;

    public PaymentMonthlyList getPaymentsMonthly(int id) throws RemoteException;

    public Message paymentCharging(double rate) throws RemoteException;

    public Message recountCharge(Student st) throws RemoteException;

    public boolean isChargingWarrant() throws RemoteException;

    public Message addPaymentCharge(int idStudent, int month, int year, double sumGrn, double sumUsd) throws RemoteException;

    public Vector getStatuses() throws RemoteException;

    public String getStatusName(int idStatus) throws RemoteException;

    public Integer getStatusID(String statusName) throws RemoteException;

    public Vector getStudents(String str) throws RemoteException;

    public Vector getForeignStudents(String str) throws RemoteException;

    public Message finishYear() throws RemoteException;

    public boolean isAlreadyMovedUp() throws RemoteException, SQLException;


    public int addPaymentYear() throws RemoteException;

    public Vector getPaymentYears() throws RemoteException;

    public Integer getPaymentYearID(String name) throws RemoteException;

    public String getPaymentYear(int id) throws RemoteException;

    public Date getCurrentDate() throws RemoteException;


    public QueryResult executeDBObject(DBObject ob, boolean withResultSet) throws RemoteException, SQLException;

    public Collection<DBObject> getUserDBObjects(DBObjectType type) throws RemoteException;

    public QueryResult executeQuery(String sql) throws RemoteException, SQLException;

    public void saveObject(DBObject ob, boolean needDrop) throws SQLException, RemoteException;

    public String[] getSQLKeywords() throws RemoteException;

    public void deleteDBObject(DBObject ob) throws SQLException, RemoteException;

    public String getStatusComment(StatusCommentsConstants status) throws RemoteException;

    // OLAP
    public OlapCubeInfo[] getOlapCubeInfo() throws RemoteException;

    public ReportData executeMDXQuery(String query) throws RemoteException;
}